package com.itheima.service;

import com.itheima.bean.ShoppingCart;
import com.itheima.bean.User;

import java.util.List;

/**
 * @author hebing
 * @version 1.0
 */
public interface ShoppingCartService {
    /**
     * 添加
     * @param shoppingCart
     * @return
     */
    int add(ShoppingCart shoppingCart, User user);

    /**
     * 查看购物车
     * @return
     */
    List<ShoppingCart> findCart();

    /**
     * 清空购物车
     * @return
     */
    int clean();

    /**
     * 根据用户id查询购物车
     * @param currentId
     * @return
     */
    List<ShoppingCart> selectByUserId(Long currentId);

    /**
     * 移除购物车
     * @param shoppingCart
     * @return
     */
    int subside(ShoppingCart shoppingCart);
}
